package com.ruoyi.game.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.game.domain.GameXinfa;
import com.ruoyi.game.mapper.GameXinfaMapper;
import com.ruoyi.game.service.IGameXinfaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 心法Service业务层处理
 *
 * @author ghostmen
 * @date 2024-10-29
 */
@Service
public class GameXinfaServiceImpl implements IGameXinfaService {

    @Autowired
    private GameXinfaMapper gameXinfaMapper;

    /**
     * 查询心法
     *
     * @param xinfaId 心法主键
     * @return 心法
     */
    @Override
    public GameXinfa selectGameXinfaByXinfaId(Long xinfaId) {
        return gameXinfaMapper.selectGameXinfaByXinfaId(xinfaId);
    }

    /**
     * 查询心法列表
     *
     * @param gameXinfa 心法
     * @return 心法
     */
    @Override
    public List<GameXinfa> selectGameXinfaList(GameXinfa gameXinfa) {
        return gameXinfaMapper.selectGameXinfaList(gameXinfa);
    }

    /**
     * 新增心法
     *
     * @param gameXinfa 心法
     * @return 结果
     */
    @Override
    public int insertGameXinfa(GameXinfa gameXinfa) {
        gameXinfa.setCreateTime(DateUtils.getNowDate());
        return gameXinfaMapper.insertGameXinfa(gameXinfa);
    }

    /**
     * 修改心法
     *
     * @param gameXinfa 心法
     * @return 结果
     */
    @Override
    public int updateGameXinfa(GameXinfa gameXinfa) {
        gameXinfa.setUpdateTime(DateUtils.getNowDate());
        return gameXinfaMapper.updateGameXinfa(gameXinfa);
    }

    /**
     * 批量删除心法
     *
     * @param xinfaIds 需要删除的心法主键
     * @return 结果
     */
    @Override
    public int deleteGameXinfaByXinfaIds(Long[] xinfaIds) {
        return gameXinfaMapper.deleteGameXinfaByXinfaIds(xinfaIds);
    }

    @Override
    public int deleteByXinfaIds(Long[] xinfaIds) {
        return gameXinfaMapper.deleteByXinfaIds(xinfaIds);
    }

    /**
     * 删除心法信息
     *
     * @param xinfaId 心法主键
     * @return 结果
     */
    @Override
    public int deleteGameXinfaByXinfaId(Long xinfaId) {
        return gameXinfaMapper.deleteGameXinfaByXinfaId(xinfaId);
    }
}
